#!/usr/bin/python
#-*- coding: UTF-8

import sys

# http://unicode.org/reports/tr44/#GC_Values_Table
def pass_code(codepoint, category, decomps):
	return category in (
		'Ll', 'Lu', 'Lt', 'Lo',  # letters
		'Nl', 'Nd', 'No',  # numbers
		'Pc', 'Pd', 'Ps', 'Pe', 'Pi', 'Pf', 'Po',  # punctuation
		'Sc', 'Sm'  # symbols
	) and decomps.find('<') < 0  # exclude <control>, <compat>, etc

for line in sys.stdin:
	codepoint, _, category, _, decomps = line.strip().split(';')[0:5]
	if pass_code(codepoint, category, decomps):
		print codepoint
